import os
from git import Repo

WORK_PATH = r'E:\\python\\codeBlock\\'

# Merge branch name, FROM_BRANCH -> TO_BRANCH
FROM_BRANCH = 'master'
TO_BRANCH = 'xxxx'
# Repo name
REPO_NAME = "xxxx"
repo = Repo(WORK_PATH)

git = repo.git
# Check out origin branch
print('git checkout origin ' + FROM_BRANCH)
git.checkout(FROM_BRANCH)
git.pull('--progress', '--no-rebase', 'origin', FROM_BRANCH)